<?php

    if(!defined('BASEPATH'))
        exit('No direct script access allowed');

    class mail_send
    {

        private $from="no-replay";
        private $to;
        private $subject="Notification Email";
        private $message;
        
        public function __construct(){

            $this->CI = &get_instance();

        }

        public function getFrom()
        {
            return $this->from;

        }

        public function setFrom($from)
        {
            $this->from=$from;

        }

        public function getTo()
        {
            return $this->to;

        }

        public function setTo($to)
        {
            $this->to=$to;

        }

        public function getSubject()
        {
            return $this->subject;

        }

        public function setSubject($subject)
        {
            $this->subject=$subject;

        }

        public function getMessage()
        {
            return $this->message;

        }

        public function setMessage($message)
        {
            $this->message=$message;

        }

        public function send()
        {
            if(!isset($this->to))
                return FALSE;

            if(!isset($this->message))
                return FALSE;

            $headers="From: ".$this->from."\r\n";
            $headers .= "Content-type: text/html\r\n";

            return mail($this->to, $this->subject, $this->message, $headers); //0 or 1

        }

    }

?>
